using System;
using UnityEngine;

public class GetEnergyBehaviour : SteeringBehaviour
{
	public GetEnergyBehaviour ()
	{
	
	}
	

	public override Vector3 getSteering (AgentBehaviourScript agent)
	{	
		
		// on error return the agent destination
		try
		{
			return agent.getNearestEnergy().getPosition();
		}
		catch
		{
			return agent.getDestination();
		}
	}
	
}

